package xin.pms.ui;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import xin.pms.model.User;

import java.io.Serializable;
import java.util.Date;

/**
 * <pre>
 * Ui User
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @version 1.0
 * @since 2018/7/28 18:39
 */
@Data
public class UiUser implements Serializable{
    private  String id;
    private String userName;
    private String name;
    private String mobile;
    private String wechat;
    private String mail;
    private boolean deleted;
    private boolean locked;
    private String idType;
    private String idNum;
    private String company;
    private String department;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    protected Date createTime;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    protected Date lastModifyTime;
    public UiUser(){

    }
    public UiUser(User user){
        if(user != null ){
            this.id = user.getId();
            this.userName = user.getUserName();
            this.name = user.getName();
            this.mobile = user.getMobile();
            this.wechat = user.getWechat();
            this.mail = user.getMail();
            this.deleted = user.getDeleted();
            this.locked = user.getLocked();
            this.idType = user.getIdType();
            this.idNum = user.getIdNum();
            this.company = user.getCompany();
            this.department = user.getDepartment();
            this.createTime = user.getCreateTime();
            this.lastModifyTime = user.getLastModifyTime();
        }
    }
}
